home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 113 / gfatip07 / gfatip07.doc < prev   
Text File  |  1987-09-25  |  18KB  |  355 lines

  1.  
  2.  
  3.                                                 August 15, 1987
  4.  
  5.  
  6.                            GFATIP07.DOC
  7.  
  8.                         by John B. Holder
  9.                      Senior Software Engineer
  10.                      Marathon Computer Press
  11.            Asst. Sysop on GEnie's MichTron Roundtable
  12.  
  13.  
  14.      This is the 7th in a planned series of GFA Tip files.  The 
  15. topic of this issue is source code control and .LST file linking.  
  16. Before we get into the nitty gritty of the subject, a bit of 
  17. background is necessary first.  
  18.  
  19.  
  20.      In most of the heavy duty languages such as C, Modula 2, 
  21. Pascal, and Assembler there is usually a utility that will either 
  22. help you to track a project's progress as you develop it and 
  23. thereby allowing total control over a modular development project.  
  24. In the UNIX(tm) world there are many utilities to aid you in this 
  25. pursuit.  They are TOUCH, MAKE, and DIFF to name just a few.  
  26. Since Marathon Computer Press is always working on a multitude of 
  27. projects at any time, it is easy for one of our staff programmers 
  28. to be involved in more than one project at a time.  Speaking for 
  29. myself, I am sometimes working on 3-4 at a time, so source code 
  30. control becomes a paramount concern.  How many times have you been 
  31. working on a programming project, and have to set it aside for a 
  32. week or two, then when returning you don't remember where you were 
  33. at or file names appear different?  If you've been programming for 
  34. more than just a short time, this will occur rather frequently 
  35. unless you are much more organized than the bulk of us.
  36.  
  37.      How does this pertain to this GFA Tip file?  Well, I 
  38. personally found a need for some sort of scheme to store my 
  39. various GFA Basic source code files when they began to approach 3 
  40. Megabytes, so I decided to devise a storage & linkage scheme.  
  41. Since my GFA Environment is on an ATARI SH204(tm) hard disk, I 
  42. chose not to use ARC.TTP to archive my files since room was not 
  43. really a concern.  The main concern for me was keeping track of 
  44. the massive amounts of files, and then how to bring them all 
  45. together in a programming project without having to use the GFA 
  46. Basic editor to first Save a .LST file then load a .BAS file and 
  47. merge the two and save the new .BAS file composed of the two 
  48. parts.  Sound pretty complicated.... Well it's not really, but 
  49. then again anything that will save time is very important to me.  
  50. Being in the computer software business I have learned to 
  51. associate time with money.  I would like to offer a few 
  52. suggestions to you and make a few points concerning source code 
  53. control before going into the mechanics of GFALINK.TTP.
  54.  
  55.                           Suggested DO's
  56.  
  57. 1.  Always set the current Date & Time on your system before 
  58. starting a programming session.
  59.  
  60. 2.  Set up separate directories for your .LST, .BAS, and .PRG 
  61. files. ( And use them religiously! )
  62.  
  63. 3.  Keep good control over .BAK files and delete them when they 
  64. are no longer necessary.
  65.  
  66. 4.  Move files that you no longer really use to a backup storage 
  67. floppy diskette.  ( Makes more room to work with on your primary 
  68. working drive )
  69.  
  70.      By following the above suggestions, you will have about 60% 
  71. of the battle licked, but there is more...
  72.  
  73.      With the introduction of PASCAL in the early 70's, C in the 
  74. mid 70's and Modula in 1976 people were introduced to structured 
  75. programming.  Some of the concepts presented by Prof. Niklaus 
  76. Wirth of Swiss Federal Institute of Technology, (ETH, 
  77. Eidgenossische Technische Hochschule) have established him as the 
  78. father of the Structured Languages.  His most notable 
  79. accomplishments include PASCAL and his latest successor to that 
  80. language, MODULA 2.  These languages set themselves apart 
  81. from the earlier languages such as FORTRAN (1956), and BASIC 
  82. (Circa 1962), by differing radically from these venerable old 
  83. beasts in a multitude of ways.
  84.  
  85.      In the earlier languages the primary Control Structure was 
  86. the GOTO command.  The use of these structures caused the execution 
  87. of the programs to jump back and forth within code at any whim of 
  88. the programmer, thereby making it extremely difficult both to 
  89. trace the code and to identify errors.  Hence, the word Structured 
  90. Programming came from the Strongly Type Checked languages of Pascal 
  91. and Modula 2.  The use of procedures within a program allowed a 
  92. logical flow of control within a program and was the tool whereby 
  93. code was made infinitely more readable and maintainable.  This 
  94. art has improved over the years, and now Prof. Wirth's latest 
  95. endeavor lends itself totally to the modular programming concept, 
  96. alas the name of Modula 2.  With Modula 2 everything is a Module, 
  97. and procedures are the main structures within the module.
  98.      You may ask, how does this pertain to GFA Basic?  Well, the 
  99. systems programmers at GFA Systemtechnik set out to develop a new 
  100. Basic that would retain the better parts of the original forms of 
  101. Basic, yet incorporate the better parts of the Structured 
  102. languages such as Pascal or Modula 2.  However, they did not 
  103. provide any source code control utilities other than the GFA Basic 
  104. Interpreter's own inherent editor.  They left the control of code 
  105. up to you.  That's where the Linker comes in...
  106.  
  107.                 GFALINK.TTP Instructions and usage 
  108.  
  109.      I found it infinitely more manageable to use GFA Basic's 
  110. structure to help me build libraries for use with my projects.  By 
  111. this I mean that I set up my environment by building little 
  112. software chips in the form of procedures and put them on the shelf 
  113. so to speak, ready to be pulled off the shelf and used in any 
  114. project I chose.  How do you accomplish this task?  It's so 
  115. simple, you'll be doing it in no time at all.  Just develop a 
  116. procedure to accomplish a specific task, such as a time changing 
  117. routine, a drive map routine, or whatever.  Next, snip out the 
  118. procedure using the Mark Block and Write Block routines within the 
  119. GFA Basic Editor.  Save the procedure as a .LST file in your .LST 
  120. folder, (previously established).  By doing this you have created 
  121. a procedure for your current project, but you have also set aside 
  122. that tiny little software chip to use on another day with another 
  123. project.  This saves you a ton of time in either trying to 
  124. reinvent the wheel in a new project or searching through reams of 
  125. code you created earlier trying to find the elusive routine that 
  126. you need now.  This practice of building library functions or 
  127. procedures to be used at a later date is a corner stone of Modula 
  128. and the newest of the structured programming languages, ADA.  If 
  129. you want to create your own libraries from programs you have 
  130. created and are currently in .BAS file format, then use the editor 
  131. to snip out and save those procedures in .LST file format, ready 
  132. to be merged in a future endeavor.
  133.      A word of caution is in store here.  You should identify all 
  134. of your variables and strings within the procedure at the top 
  135. either in REM statements or a series of Equates.  Example:
  136.  
  137.      Procedure Do_this_thing
  138.      Rem Created 8/15/87 
  139.      A_number=100
  140.      A_string="This is the Do_this_thing Procedure"
  141.      .
  142.      .
  143.      . Body of the procedure
  144.      Return ! Do_this_thing Procedure
  145.  
  146.      By doing this you will have to take a bit more time, but it 
  147. will save you many headaches by not having to try to find out why 
  148. a variable keeps getting changed, (If it's used in another 
  149. procedure).  Keep track of your LOCAL variables also, because you 
  150. are sure to crash your system if you call or try to use a LOCAL 
  151. variable outside of the Parent Procedure.
  152.  
  153.      Now you might say "Gee .. Thanks for the advice, but I still 
  154. don't understand what GFALINK.TTP will do for me!".  For those 
  155. people here is the answer:
  156.  
  157.      Place a copy of your GFALINK.TTP program in your .LST folder 
  158. along with all of the modules that you have created, (by storing 
  159. procedures in .LST file format with the GFA Basic editor).  Any 
  160. time in the future, if you need to use say 4 or 5 of your software 
  161. chips, it's as simple as double clicking on GFALINK.TTP and 
  162. entering the following on the command line:
  163.  
  164.      file1.lst file2.lst file3.lst newfile.lst
  165.  
  166.      Next click on OK and your files will be joined effortlessly 
  167. for you into the file you name as "newfile.lst", or whatever you 
  168. want your output file to be named.  In essence it has performed a 
  169. multi-file merge without using the GFA Basic Editor and having to 
  170. step through the Merge+File select box+OK for each of the files 
  171. you choose to "link together".
  172.  
  173.      Warnings:
  174. 1. Be sure to give the last file in the command line a unique 
  175. name, (One different from all other .LST files within the 
  176. directory), or you'll erase the old file.  Also don't forget to 
  177. give the "newfile.Lst" name or the last file in the link will be 
  178. replaced by the newly created LINK'ed file.
  179.  
  180. 2. The GFALINK.TTP file must reside in the same directory as all 
  181. files to be included in the link, or the link will fail.
  182.  
  183. Suggestions:
  184.  
  185.      For the most successful use of GFALINK.TTP, I would suggest 
  186. that you get a good CLI (command line interpreter), such as 
  187. MichTron's DOS Shell by Timothy Purves.  Since the command line 
  188. that appears from the desk top is limited, you can only merge a 
  189. few files at a time in this manner.  However, with DOS Shell, (or 
  190. a CLI) you can enter many many more files into the link at a 
  191. single time.  It will all depend on the CLI and how many 
  192. characters can be on a single command line.  Dos Shell can allow 
  193. up to 128 characters on a command line.  Or you may choose to 
  194. automate a GFALINK sequence with a .BAT file.  A Bat file allows 
  195. you to enter a number of commands in a file to be sequentially 
  196. executed by the CLI when called on.
  197.  
  198.      For those that dabble with C, this procedure gives a GFA 
  199. Basic programmer the ability to create his own form of UNIX's(tm) 
  200. Make Utility.  You could create a Makefile.Bat to be executed by a 
  201. CLI.  In this makefile you would call on GFALINK.TTP to link 
  202. several modules for you and then chain to either the compiler or 
  203. interpreter.  You will have to refer to the instructions that come 
  204. with your CLI to see how to set up .BAT files and execute GEM 
  205. programs.  For example DOS Shell uses the command RUN to execute a 
  206. GEM(tm) program such as the GFA Basic Compiler or Interpreter.
  207.  
  208.                  Technical Aspects of GFALINK.TTP
  209.  
  210.      Since this program is not GEM(tm) based it can be run from 
  211. most CLI's without having to rename it with a .PRG suffix, and 
  212. will normally not require any special pre-command to execute.  The 
  213. Linker itself was created with the Lattice C vers. 3.03.04 
  214. compiler.  C was chosen to enable the reading of commands (file 
  215. names) passed to the program from a shell (CLI).
  216.  
  217.      The linker will accept up to 26 files in the link, but this 
  218. may be limited by the length of the file names and the command 
  219. line buffer.  I would suggest that you only attempt to link 10-15 
  220. files at the maximum in a single step.  If you have more you can 
  221. do a series of linking actions.  Just use the subsequent 
  222. "newfile.lst" as the first file in the second step linking 
  223. command.  Just be sure to name the next output file as something 
  224. different that the first such as "newfile2.lst" instead of 
  225. "newfile.lst" to prevent spooling on top of the first file in the 
  226. successive link.
  227.  
  228.      The linker is very fast, but is I/O intensive.  No buffers 
  229. have been established so there is not a burden on memory in most 
  230. cases.  Very Large Files will take a long time in the link so be 
  231. patient.  It should still save you time compared with the GFA 
  232. Basic Merge process even if you have exceptionally large .LST 
  233. files in your link.  It was designed to link files in the 1K to 
  234. 25K size range, but will work with any size file.  You will find 
  235. that GFALINK.TTP will link together any data files or ASCII files 
  236. you might desire to join, so you may use this utility elsewhere.  
  237. It will not successfully merge GFA Basic .BAS file format files, 
  238. so don't try.  It'll join them for you, but the editor will not 
  239. recognize any files beyond the first.
  240.  
  241.      Disclaimer:
  242.  
  243.      As with any program that writes data to your disk, you should 
  244. read the operation instructions presented above thoroughly before 
  245. trying to use GFALINK.TTP.  It will do what you tell it to, so be 
  246. sure all of the filenames are unique on output, or it'll write 
  247. over an existing file.
  248.  
  249.      This program has been placed in the public domain as a Free 
  250. of Charge utility.  You accept full response for the use of the 
  251. program and it's your responsibility to decide it's applicability 
  252. for fitness for a particular purpose.  Neither myself, nor MCP 
  253. will be responsible for any damages to your equipment, files, or 
  254. computer resulting from the use of this Public Domain Utility 
  255. Program.
  256.  
  257.                  (c) Copyright Notification      
  258.  
  259.      This utility is a copyrighted utility program by the name of 
  260. GFALINK.TTP. (c)1987 Marathon Computer Press, All rights are 
  261. reserved.  It has been placed in the public domain for the 
  262. exclusive use of Legal owners of GFA Basic, and the GFA Basic 
  263. Compiler only.  It may not be distributed in any Public Domain 
  264. program package that any fee at all is assessed.  You may post it 
  265. on any BBS that you choose, however if you want to sell it as a 
  266. part of any package you must contact:
  267.  
  268.                      Marathon Computer Press
  269.                           P.O. Box 68503
  270.                  Virginia Beach, Virginia  23455
  271.  
  272.      If you liked this program, drop us a letter at the above 
  273. address.  We'd like to hear from you.
  274.  
  275.                  Or drop us an EMAIL letter on :
  276.                          
  277.                          Genie = GRIFJOHN
  278.  
  279.                          CIS = 75766,505
  280.  
  281.      I hope that at least some of the concepts presented in this 
  282. GFATIP file will help you to be a more productive programmer, and 
  283. if the GFALINK.TTP program will help you then all the much better.
  284. I've included the Press Release for The GFA Basic Companion(tm) at 
  285. the bottom of this Doc file because the concept is graphically 
  286. carried out by the Source Code Generator within the Companion.  
  287. It's truly destined to make you change the way you think about 
  288. programming in GFA Basic.  Besides I thought I'd try to get a 
  289. commercial in since I had your attention.  Have fun!
  290.  
  291.                           John B. Holder
  292.  
  293.  
  294.                           Press Release
  295.  
  296. *****************************************************************
  297. For further information contact:
  298.      Gordon Monnier
  299.      President, MichTron
  300.  
  301. For Immediate Release:
  302.      MichTron announces the release of The GFA BASIC
  303. Companion, a dedicated RCS package designed to create dialog
  304. boxes and more for GFA BASIC programs.
  305.      GFA BASIC owners now have a new, incredibly useful tool
  306. available that will cut the time and annoyance often (if not
  307. always) associated with programming in GEM with BASIC.
  308. Already the possessors of the best BASIC available for any
  309. computer, GFA users can now build Radio Button Boxes, Dialog
  310. Boxes, Help Text Boxes, Sliders, Error Boxes, and more with
  311. The GFA BASIC Companion.  They can even design their own
  312. custom boxes with the companion's amazing dialog box source
  313. code generator.
  314.       Best of all, these objects, once created, are stored in 
  315. GFA BASIC's ASCII.LST file format so they can be studied,
  316. modified, or merged into a GFA BASIC program.
  317.      The GFA BASIC Companion Dialog box source code
  318. generator produces quick Dialog Boxes easily so even the
  319. newest programmers can give their programs an elegant,
  320. professional look, but the Custom Design Option gives the
  321. total control and creativity necessary to satisfy the
  322. hungriest of "power users".
  323.      The GFA BASIC Companion will change the way you think
  324. about programming in GFA BASIC on the ST.  You'll find that
  325. by using several of the GFA BASIC resident commands you can
  326. create a versatile user interface that will mimic routines
  327. available in the GEM AES, but in an adaptive format that is
  328. easier to learn and change.  Altering one of these routines
  329. is simply a matter of loading the BAS. or LST. file into the
  330. GFA BASIC Editor and changing the desired portions in a real
  331. time mode that allows immediate testing of all your changes.
  332. This isn't possible in a standard RCS, such as the one
  333. included in the ATARI ST developers kit.  Consider the time
  334. that will be saved and the headaches that will be cured by
  335. such an interface.
  336.      Other attractions of The GFA BASIC Companion include an
  337. extensive online Tutorial that may be viewed from a window,
  338. or printed out for further study.
  339.      A demonstration of this amazing product can be
  340. Downloaded from the CompuServe ATARI 16 libraries or from
  341. GEnie's Michtron Roundtable.  If you would like 
  342. to take a look at the capabilities of The GFA
  343. BASIC Companion, you may send for a Demo Disk.  Specify
  344. color or monochrome and send five dollars ($5) to :
  345.  
  346.                MichTron,Inc.
  347.                576 South Telegraph
  348.                Pontiac, Michigan  48053
  349.                     (313) 334-5700
  350.      The GFA BASIC Companion is an exciting addition to your
  351. library of GFA BASIC products and is available from MichTron
  352. for $49.95.
  353.  
  354.                     -END-
  355.